package BinaryTree.后序;

import 其他.DataStructure.TreeNode;

public class 板子 {
    //c.l.r都可N (c非N)
    public int back(TreeNode cur){
        if(cur==null){
            return 0;
        }

        int leftRes = back(cur.left);
        int rightRes = back(cur.right);

        // curRes
        return cur.val + leftRes + rightRes;
    }
}
